<template>
	<view>
		<u-navbar :safeAreaInsetTop="false">
			<view class="u-nav-slot" slot="left">
				<image src="/static/images/back_three.svg" class="icons" @click="goback"></image>
			</view>
			<view class="u-nav-slot" slot="center">
				<view class="nav-title">赞     过</view>
			</view>
			<view class="u-nav-slot" slot="right">
				<image src="/static/images/search.png" class="icons" @click="search()"></image>
			</view>
		</u-navbar>
	<view style="position: relative;padding:120rpx 30rpx 140rpx 30rpx">
		<view v-if="list.length>0">
		<view v-for="item,index in list" class="item col" :key="index">
			<view class="row">
				<image class="book" :src="item.coverPics[0]">
				</image>
				<view class="col" style="margin-left: 20rpx;width: 100%;">
					<view class="book-title">
						{{item.workTitle}}
					</view>
					<view class="book-category">
						#{{item.itemId}} {{item.itemTitle}}
					</view>
					<view class="row-between-center " style="margin-top:80rpx">
						<view class="book-time">
							人气1.2亿
						</view>
						
						<image src="/static/images/me-zan4.svg" class="star" @click="cancelZan(item)"></image>
						
					</view>
				</view>
			<view class="">
				
			</view>	</view>
		</view>
		</view>
		<view class="col-center no-data" v-else>
			暂无记录
		</view>
	</view>
	</view>
</template>

<script>
		import titlebar from '@/pages/common/titlebar.vue'
		import {
			likes,itemLike
		} from '@/api/change/index.js'
	export default {
		components:{
				titlebar
		},
		data() {
			return {
				showManage:false,
				showSearch:false,
				list:[],
				keyword:''
			}
		},
		
		onLoad() {
		
		},
		mounted() {
				this.getData()
		},
		methods: {
			cancelZan(item){
				itemLike(item.itemId).then(res=>{
					this.getData()
				})
			},
			goback(){
				uni.navigateBack()
			},
			getData(){
				likes({keyword:this.keyword}).then(res=>{
					this.list =res.rows
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.icons{
		width: 50rpx;
		height: 50rpx;
	}
	.nav-title{
		color: rgba(16, 16, 16, 1);
		font-size: 40rpx;
		text-align: center;
		font-weight: bolder;
	}
	.no-data{
		height: 80vh;
		color: #9a9a9a;
		font-size: 40rpx;
		font-weight: bold;
	}
	.item{
		padding: 20rpx 30rpx;
		border-radius: 30rpx;
		background-color: rgba(255, 255, 255, 1);
		color: rgba(16, 16, 16, 1);
		margin-bottom: 40rpx;
		.title{
			color: rgba(16, 16, 16, 1);
			font-size: 56rpx;
			font-family: PMZDBiaoTi-regular;
		}
		.star{
			width: 60rpx;
			height: 60rpx;
		}
		.img{
			margin-top: 10rpx;
			background-color: red;
			width: 100%;
			height: 360rpx;
			border-radius: 10px;
		}
		.update{
			color: rgba(16, 16, 16, 1);
			font-size: 32rpx;
		}
		.count{
			color: rgba(16, 16, 16, 1);
			font-size: 36rpx;
		}
		
		.book{
			flex-shrink: 0;
			width: 200rpx;
			height: 240rpx;
			border-radius: 20rpx;
		}
		.book-title{
			color: rgba(0, 0, 0, 1);
			font-size: 40rpx;
		}
		.book-category{
			margin-top: 10rpx;
			color: rgba(0, 0, 0, 1);
			font-size: 40rpx;
			font-weight: bold;
		}
		.book-time{
			color: rgba(16, 16, 16, 1);
			font-size: 32rpx;
		}
	}
</style>
